# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgbase=libwebkit
pkgname=(libwebkit)
pkgver=1.4.0
pkgrel=1
pkgdesc="An opensource web content engine"
arch=('ppc')
url="http://webkitgtk.org/"
license=('custom')
depends=('libxt' 'libxslt' 'sqlite3' 'icu' 'gstreamer0.10-base' 'libsoup' 'enchant' 'cairo')
makedepends=('flex' 'gperf' 'gobject-introspection' 'python2' 'gtk2' 'pkg-config' 'libtool')
#install=libwebkit.install
source=(http://webkitgtk.org/webkit-${pkgver}.tar.gz gcc46.patch)
md5sums=('10c969db3b5484c71df1aa9a338377ff'
         '970a2fa91b9827dff8e9b9edb4867701')

build() {
  cd "${srcdir}/webkit-${pkgver}"
  patch -Np1 -i "${srcdir}/gcc46.patch"
  mkdir build-gtk2

  ( cd build-gtk2 && _build --with-gtk=2.0 )
}

_build() {
  PYTHON=/usr/bin/python2 ../configure --prefix=/usr \
    --enable-introspection \
		--disable-glibtest \
		--disable-jit \
    --with-font-backend=freetype --disable-gtk-doc-html \
		--without-html-dir \
    --with-unicode-backend=icu
  make
}

package_libwebkit() {
  pkgdesc+=" (for GTK2)"
  depends+=(gtk2)

  cd "$srcdir/webkit-$pkgver/build-gtk2"
  make DESTDIR="${pkgdir}" install
  install -Dm644 ../Source/WebKit/LICENSE "${pkgdir}/usr/share/licenses/libwebkit/LICENSE"
}
